<template>
	<view>
		<view class="touxiang"  v-for="item in comments" :key="item.goods.id">
			<u--image class="tupian" width="80" height="80"
				:src="item.user.avatarUrl" shape="circle">
			</u--image>
			<view class="xingxing">
				<u--text mode="name" :text="item.user.nick" format="encrypt" size="27"></u--text>
				<u-rate :count="5" v-model="item.goods.amount" size="14" align="right"></u-rate>
			</view>
			<u--text mode="date" :text="item.goods.dateReputation" style="margin-left: 400px;"></u--text>
		</view>
		<view class="xitong">
			<u--text class="doushi" text="系统默认好评 " color="#969799" size="23" margin="20" lineHeight="36"></u--text>
		</view>
	</view>
</template>

<script>
	import {

	goodsReputation

	} from "../../api/detail.js"
	export default {
		data() {
			return {
			
				count: 5,
				value:'',
				comments: [],
				goodsId:'',
				
			}
		},
		methods: {
			
			getgoodsReputation() {
				
				goodsReputation({
				goodsId: this.goodsId
				}).then(res => {
					console.log(res);
					
						
					if (res.code === 0) {
					
						this.comments = res.data.result
					

					}
					

				})
			},
		},
		onShow() {
		
			this.getgoodsReputation()

		
		},
		onLoad(option) {
		
			this.goodsId = option.id
			console.log(this.goodsId);
		}
	}
</script>

<style lang="scss">
	.touxiang {
		display: flex;
		margin-left: 12px;
		margin-top: 50px;
	}

	.touxiang>.tupian {
		margin-right: 20px;
	}

	.touxiang>.xingxing {
		margin-top: 10px;
	}

	.xitong {
		margin-left: 12px;
		margin-top: 30px;
	}

	.gengduo {
		margin-top: 90px;
	}
	.u-text{
		margin-right: 10px;
	}
</style>
